package com.swa99ylum.pjv.sample.s03_corrector.s0300;

import java.util.Map;

import org.apache.commons.lang3.ArrayUtils;

import com.swa99ylum.pjv.corrector.Corrector;

/**
 * 修正方式：将 grade 改为 中文
 *
 */
public class Corrector0 extends Corrector {
	@Override
	public void doCorrect(Object rootObject, String[] nodePath, String nodeName, Map<String, Object> parentValue, Object incorrectValue) {
		
		int[] 	 a1 = new int[] 	{1, 2, 3, 4, 5};
		String[] a2 = new String[] 	{"一", "二", "三", "四", "五"};
		
		int index = ArrayUtils.indexOf(a1, (int)incorrectValue);
		
//		JSONPath.set(rootObject, nodePath, a2[index]);
		parentValue.put(nodeName, a2[index]);
			
	}
}
